home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  6.5 KB  |  205 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    xxx put contents here xxx
  5.  
  6.      Version:    Technology:    
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DRIVERFAMILYMATCHING__
  19. #define __DRIVERFAMILYMATCHING__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __NAMEREGISTRY__
  25. #include <NameRegistry.h>
  26. #endif
  27. #ifndef __CODEFRAGMENTS__
  28. #include <CodeFragments.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*
  54.   ##############################################
  55.    Well known properties in the Name Registry
  56.   ##############################################
  57. */
  58.  
  59. #define kPropertyName                    "name"
  60. #define kPropertyCompatible                "compatible"
  61. #define    kPropertyDriverPtr                "driver-ptr"
  62. #define kPropertyDriverDesc                "driver-description"
  63. #define kPropertyReg                    "reg"
  64. #define kPropertyAAPLAddress            "AAPL,address"
  65. #define kPropertyMatching                "matching"
  66.  
  67. /* CPassThru */
  68. /*
  69.   #########################################################
  70.    Descriptor for Drivers and NDRVs
  71.   #########################################################
  72. */
  73. /* Driver Typing Information Used to Match Drivers With Devices */
  74. struct DriverType {
  75.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  76.     NumVersion                         version;                    /* Driver Version Number*/
  77. };
  78. typedef struct DriverType DriverType;
  79.  
  80. typedef DriverType *                    DriverTypePtr;
  81. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  82. typedef OptionBits                         RuntimeOptions;
  83.  
  84. enum {
  85.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  86.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  87.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  88.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  89.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  90.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  91.     kDriverIsForVirtualDevice    = 0x00000040,                    /* Driver is for a virtual Device */
  92.     kDriverSupportDMSuspendAndResume = 0x00000080                /* Driver supports Device Manager Suspend and Resume command */
  93. };
  94.  
  95. struct DriverOSRuntime {
  96.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  97.     Str31                             driverName;                    /* Driver's name to the OS*/
  98.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  99. };
  100. typedef struct DriverOSRuntime DriverOSRuntime;
  101.  
  102. typedef DriverOSRuntime *                DriverOSRuntimePtr;
  103. /* OS Service Information Used To Declare What APIs a Driver Supports */
  104. typedef UInt32                             ServiceCount;
  105. struct DriverServiceInfo {
  106.     OSType                             serviceCategory;            /* Service Category Name*/
  107.     OSType                             serviceType;                /* Type within Category*/
  108.     NumVersion                         serviceVersion;                /* Version of service*/
  109. };
  110. typedef struct DriverServiceInfo DriverServiceInfo;
  111.  
  112. typedef DriverServiceInfo *                DriverServiceInfoPtr;
  113. struct DriverOSService {
  114.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  115.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  116. };
  117. typedef struct DriverOSService DriverOSService;
  118.  
  119. typedef DriverOSService *                DriverOSServicePtr;
  120. /* Categories */
  121.  
  122. enum {
  123.     kServiceCategoryDisplay        = FOUR_CHAR_CODE('disp'),        /* Display Manager*/
  124.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),        /* Open Transport*/
  125.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),        /* Block Storage*/
  126.     kServiceCategoryNdrvDriver    = FOUR_CHAR_CODE('ndrv'),        /* Generic Native Driver*/
  127.     kServiceCategoryScsiSIM        = FOUR_CHAR_CODE('scsi'),        /* SCSI */
  128.     kServiceCategoryFileManager    = FOUR_CHAR_CODE('file'),        /* File Manager */
  129.     kServiceCategoryIDE            = FOUR_CHAR_CODE('ide-'),        /* ide */
  130.     kServiceCategoryADB            = FOUR_CHAR_CODE('adb-'),        /* adb */
  131.     kServiceCategoryPCI            = FOUR_CHAR_CODE('pci-'),        /* pci bus */
  132.                                                                 /* Nu Bus */
  133.     kServiceCategoryDFM            = FOUR_CHAR_CODE('dfm-'),        /* DFM */
  134.     kServiceCategoryMotherBoard    = FOUR_CHAR_CODE('mrbd'),        /* mother Board */
  135.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),        /* Keyboard */
  136.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),        /* Pointing */
  137.     kServiceCategoryRTC            = FOUR_CHAR_CODE('rtc-'),        /* RTC */
  138.     kServiceCategoryNVRAM        = FOUR_CHAR_CODE('nram'),        /* NVRAM */
  139.     kServiceCategorySound        = FOUR_CHAR_CODE('sond'),        /* Sound (1/3/96 MCS) */
  140.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),        /* Power Management */
  141.     kServiceCategoryGeneric        = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  142. };
  143.  
  144. /* Ndrv ServiceCategory Types */
  145.  
  146. enum {
  147.     kNdrvTypeIsGeneric            = FOUR_CHAR_CODE('genr'),        /* generic*/
  148.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),        /* video*/
  149.     kNdrvTypeIsBlockStorage        = FOUR_CHAR_CODE('blok'),        /* block storage*/
  150.     kNdrvTypeIsNetworking        = FOUR_CHAR_CODE('netw'),        /* networking*/
  151.     kNdrvTypeIsSerial            = FOUR_CHAR_CODE('serl'),        /* serial*/
  152.     kNdrvTypeIsParallel            = FOUR_CHAR_CODE('parl'),        /* parallel */
  153.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),        /* sound*/
  154.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg')
  155. };
  156.  
  157. typedef UInt32                             DriverDescVersion;
  158. /*    The Driver Description */
  159.  
  160. enum {
  161.     kInitialDriverDescriptor    = 0,
  162.     kVersionOneDriverDescriptor    = 1
  163. };
  164.  
  165.  
  166. enum {
  167.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  168.     kDriverDescriptionSignature    = FOUR_CHAR_CODE('pdes')
  169. };
  170.  
  171.  
  172. struct DriverDescription {
  173.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  174.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  175.     DriverType                         driverType;                    /* Type of Driver*/
  176.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  177.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  178. };
  179. typedef struct DriverDescription DriverDescription;
  180.  
  181. typedef DriverDescription *                DriverDescriptionPtr;
  182.  
  183.  
  184.  
  185. #if PRAGMA_STRUCT_ALIGN
  186.     #pragma options align=reset
  187. #elif PRAGMA_STRUCT_PACKPUSH
  188.     #pragma pack(pop)
  189. #elif PRAGMA_STRUCT_PACK
  190.     #pragma pack()
  191. #endif
  192.  
  193. #ifdef PRAGMA_IMPORT_OFF
  194. #pragma import off
  195. #elif PRAGMA_IMPORT
  196. #pragma import reset
  197. #endif
  198.  
  199. #ifdef __cplusplus
  200. }
  201. #endif
  202.  
  203. #endif /* __DRIVERFAMILYMATCHING__ */
  204.  
  205.